<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改质量事故调查')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-records-edit" th:object="${gcQualityRecords}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="gcProjectid" th:value="${gcProjectid}" type="hidden">
        	<input name="sgazhtId" th:value="${sgazhtId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">合同编号：</label>
                <div class="col-sm-4">
                    <input name="orderNo" th:field="*{orderNo}" class="form-control" type="text" readonly="readonly" required>
                </div>
                <label class="col-sm-2 control-label is-required">工程名称：</label>
                <div class="col-sm-4">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">建设单位：</label>
                <div class="col-sm-4">
                    <input name="construction" th:field="*{construction}" class="form-control" type="text" required>
                </div>
                <label class="col-sm-2 control-label is-required">施工班组：</label>
                <div class="col-sm-4">
                    <input name="banz" th:field="*{banz}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">施工负责人：</label>
                <div class="col-sm-4">
                    <input name="daib" th:field="*{daib}" class="form-control" type="text" required>
                </div>
                <label class="col-sm-2 control-label is-required">班组成员：</label>
                <div class="col-sm-4">
                    <input name="peopleName" th:field="*{peopleName}" class="form-control" type="text" required> 
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">质量事故类型：</label>
                <div class="col-sm-10">
                	<label th:each="type:${dictDataLis}" class="check-box">
						<input name="qualityType" type="checkbox" th:checked="${type.listClass}" th:value="${type.dictLabel}" th:text="${type.dictLabel}" >
					</label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label is-required">事故调查详情：</label>
                <div class="col-sm-10">
                    <textarea name="descs" class="form-control" required>[[*{descs}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">事故性质：</label>
                <div class="col-sm-4">
                    <input name="nature" th:field="*{nature}" class="form-control" type="text" required>
                </div>
                <label class="col-sm-2 control-label is-required">直接经济损失：</label>
                <div class="col-sm-4">
                    <input name="loss" th:field="*{loss}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label is-required">评定及处理结果：</label>
                <div class="col-sm-10">
                    <textarea rows="5" name="result" class="form-control" required>[[*{result}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label">调查人员签名：</label>
                <div class="col-sm-10">
                    <input name="investigators" th:field="*{investigators}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">总经理意见：</label>
                <div class="col-sm-10">
                    <textarea rows="5" name="zjlOpinion" class="form-control">[[*{zjlOpinion}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" th:if="${gcQualityRecords.status} eq 0" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
    
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "gcgl/qualityRecords";
        $("#form-records-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.saveTab(prefix + "/edit", $('#form-records-edit').serialize());
            }
        }

    </script>
</body>
</html>